package com.suthund.service.Impl;

import com.suthund.bean.ManagerPO;
import com.suthund.dao.ManagerDAO;
import com.suthund.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 * Created by ALIENWARE on 2017/4/18.
 */
@Service
public class ManagerServiceImpl implements ManagerService {

    @Resource
    private ManagerDAO managerDAO;

    public ManagerPO findById(Integer id) {
        return managerDAO.findById(id);
    }

    @Async
    public List<ManagerPO> findAll() {
        return managerDAO.findAll();
    }

    @Override
    public ManagerPO addManager(ManagerPO managerPO) {
        managerDAO.insert(managerPO);
        return managerPO;
    }

    @Override
    public void deleteManager(Integer managerId) {
        managerDAO.delete(managerId);
    }



}
